package com.sss.gsb.orm.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

@Entity
@Table(name="GSB_WS_INSURANC_CPK")
public class Insurance implements Serializable {
	@Transient
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	@Transient	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Insurance other = (Insurance) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 1855403374139571354L;
	
	@ManyToOne
	@JoinColumn(name="CID")
	private Loan loan;
	
	@ManyToOne
	@JoinColumn(name="CIF")
	private Customer customer;
	
	@Id @Column(name="INSID")
	private BigDecimal id;
	
	@Column(name="HTEACH")
	private String hTeach;
	
	@Column(name="HMEM")
	private String hMem;
	
	@Column(name="C_TYPE",length=3)
	private String type;
	
	@Column(name="C_TITLE")
	private String title;
	
	@Column(name="C_NAME")
	private String name;
	
	@Column(name="C_SNAME")
	private String surname;
	
	@Column(name="CIZID")
	private String idcard;
	
	@Column(name="RUN_CODE")
	private String runCode;
	
	@Column(name="INS_CODE")
	private Integer insuranceCode  ;
	
	@Column(name="INS_BEG_DTM")
	@Temporal(TemporalType.DATE)
	private Date insuranceBegDtm;
	
	@Column(name="INS_END_DTM")
	@Temporal(TemporalType.DATE)
	private Date insuranceEndDtm;
	
	@Column(name="INS_AGE")
	private Integer insuranceAge  ;
	
	@Column(name="INS_AMT")
	private BigDecimal insuranceAmount;
	
	@Column(name="INTEREST_AMT")
	private BigDecimal interestAmount;
	
	@Column(name="TATAL_AMT")
	private BigDecimal totalAmt;
	
	@Column(name="APPLICATION_NO")
	private String applicationNo;
	
	@Column(name="BRCD")
	private Integer branceId  ;
	
	@Column(name="BRCD_NAME")
	private String branceName;
	
	@Column(name="RECEIVE_NO")
	private String receiveNo;
	
	@Embedded RecordInfo recordInfo;

	public Loan getLoan() {
		return loan;
	}

	public void setLoan(Loan loan) {
		this.loan = loan;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	public BigDecimal getId() {
		return id;
	}

	public void setId(BigDecimal id) {
		this.id = id;
	}

	public String gethTeach() {
		return hTeach;
	}

	public void sethTeach(String hTeach) {
		this.hTeach = hTeach;
	}

	public String gethMem() {
		return hMem;
	}

	public void sethMem(String hMem) {
		this.hMem = hMem;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public String getIdcard() {
		return idcard;
	}

	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}

	public String getRunCode() {
		return runCode;
	}

	public void setRunCode(String runCode) {
		this.runCode = runCode;
	}

	public Integer getInsuranceCode() {
		return insuranceCode;
	}

	public void setInsuranceCode(Integer insuranceCode) {
		this.insuranceCode = insuranceCode;
	}

	public Date getInsuranceBegDtm() {
		return insuranceBegDtm;
	}

	public void setInsuranceBegDtm(Date insuranceBegDtm) {
		this.insuranceBegDtm = insuranceBegDtm;
	}

	public Date getInsuranceEndDtm() {
		return insuranceEndDtm;
	}

	public void setInsuranceEndDtm(Date insuranceEndDtm) {
		this.insuranceEndDtm = insuranceEndDtm;
	}

	public Integer getInsuranceAge() {
		return insuranceAge;
	}

	public void setInsuranceAge(Integer insuranceAge) {
		this.insuranceAge = insuranceAge;
	}

	public BigDecimal getInsuranceAmount() {
		return insuranceAmount;
	}

	public void setInsuranceAmount(BigDecimal insuranceAmount) {
		this.insuranceAmount = insuranceAmount;
	}

	public BigDecimal getInterestAmount() {
		return interestAmount;
	}

	public void setInterestAmount(BigDecimal interestAmount) {
		this.interestAmount = interestAmount;
	}

	public BigDecimal getTotalAmt() {
		return totalAmt;
	}

	public void setTotalAmt(BigDecimal totalAmt) {
		this.totalAmt = totalAmt;
	}

	public String getApplicationNo() {
		return applicationNo;
	}

	public void setApplicationNo(String applicationNo) {
		this.applicationNo = applicationNo;
	}

	public Integer getBranceId() {
		return branceId;
	}

	public void setBranceId(Integer branceId) {
		this.branceId = branceId;
	}

	public String getBranceName() {
		return branceName;
	}

	public void setBranceName(String branceName) {
		this.branceName = branceName;
	}

	public String getReceiveNo() {
		return receiveNo;
	}

	public void setReceiveNo(String receiveNo) {
		this.receiveNo = receiveNo;
	}

	public RecordInfo getRecordInfo() {
		return recordInfo;
	}

	public void setRecordInfo(RecordInfo recordInfo) {
		this.recordInfo = recordInfo;
	}
	
}
